package io.cici.cc.mybatis.lite.sql_source.scripting.tagHandler;

import io.cici.cc.mybatis.lite.sql_source.scripting.XMLScriptBuilder;
import io.cici.cc.mybatis.lite.sql_source.scripting.tag.MixedTag;
import io.cici.cc.mybatis.lite.sql_source.scripting.tag.Tag;

import java.util.List;

public class OtherwiseTagHandler implements TagHandler {
    private final XMLScriptBuilder xmlScriptBuilder;

    public OtherwiseTagHandler(XMLScriptBuilder xmlScriptBuilder) {
        this.xmlScriptBuilder = xmlScriptBuilder;
        // Prevent Synthetic Access
    }

    @Override
    public void handle(io.cici.cc.mybatis.lite.parse.Node nodeToHandle, List<Tag> tagList) {
        MixedTag mixedTag = xmlScriptBuilder.parseDynamicTags(nodeToHandle);
        tagList.add(mixedTag);
    }
}
